BigDFT.Interop.PSI4Interop module

This module contains some wrappers for using PSI4 to perform calculations.

class PSI4Calculator(omp='1', skip=False, verbose=True)[source]

Bases: BigDFT.Calculators.Runner

Perform a calculation on a given system using the PSI4 code.

Note that if you intend to use an SAPT method, you need to pass a system which is composed of exactly two fragments.

PSI4 has a number of different actions, ab initio methods, and basis sets. Be sure to specify each of these to the run command.

os = <module 'os' from '/usr/local/anaconda/lib/python3.7/'>
post_processing(logname, command)[source]

Post processing the calculation.


a representation of the logfile.

Return type



Process local run dictionary to create the input directory and identify the command to be passed


dictionary containing the command to be passed to process_run()

Return type



Run the psi4 command.

class PSI4Logfile(sys, fname, action, method)[source]

Bases: dict

A logfile wrapper for an SAPT calculation.

This logfile inherits from a dictionary, as the properties we get out of a calculation depend on the type of calculation performed.

  • fname (str) – the name of the file to process.

  • action (str) – the action that was used when running SAPT (energy, optimize, frequency).

  • method (str) – the scf method used.

bigdft_to_psi4(sysA, sysB=None, chargeA=0, multiplicityA=None, chargeB=0, multiplicityB=None)[source]

Create a PSI4 dimer molecule which can be used for SAPT.

If multiple molecules are specified, we create a Dimer system.

  • sysA (BigDFT.Systems.System) – the first molecule.

  • sysB (BigDFT.Systems.System) – the second molecule (optional).

  • chargeA (int) – the charge of the first molecule.

  • chargeB (int) – the charge of the second molecule.

  • multiplicityA (int) – the multiplicity for unpaired electrons.

  • multiplicityB (int) – the multiplicity for unpaired electrons.


the psi4 geometry.

Return type


BigDFT.Interop.PSI4Interop example

Below we show an example of using the PSI4 interoperability functions.

def _example():
    """Example of using PSI4 interoperability"""
    from BigDFT.IO import XYZReader
    from BigDFT.Systems import System
    from BigDFT.Fragments import Fragment
    from os.path import join
    from copy import deepcopy

    # Create a system.
    reader = XYZReader(join("Database", "XYZs", ""))
    fsys = System()
    fsys["FRA:1"] = Fragment(xyzfile=reader)
    fsys["FRA:2"] = deepcopy(fsys["FRA:1"])
    fsys["FRA:2"].translate([-2, 0, 0])

    # Create a calculator.
    code = PSI4Calculator()
    log =, action="energy", basis="jun-cc-pvdz",
                   psi4_options={"scf_type": "direct"}, method="scf",

    # The raw logfile is also available.

    # Geometry optimization.
    log =, action="optimize", basis="jun-cc-pvdz",
                   method="scf", name="test-opt")

    # SAPT
    log =, action="energy", basis="jun-cc-pvdz",
                   method="sapt0", name="test-sapt")